home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_gtk / INCLUDE / GTK / GTKSELEC.{2H < prev    next >
Text File  |  1999-09-17  |  4KB  |  136 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Library General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Library General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Library General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GTK_SELECTION_H__
  28. #define __GTK_SELECTION_H__
  29.  
  30.  
  31. #include <gdk/gdk.h>
  32. #include <gtk/gtkenums.h>
  33. #include <gtk/gtkwidget.h>
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif /* __cplusplus */
  38.  
  39. typedef struct _GtkSelectionData GtkSelectioData;
  40. typedef struct _GtkTargetList    GtkTargetList;
  41. typedef struct _GtkTargetEntry   GtkTargetEntry;
  42.  
  43. struct _GtkTargetEntry {
  44.   gchar *target;
  45.   guint  flags;
  46.   guint  info;
  47. };
  48.  
  49. /* These structures not public, and are here only for the convenience of
  50.  * gtkdnd.c 
  51.  */
  52.  
  53. typedef struct _GtkTargetPair GtkTargetPair;
  54.  
  55. /* This structure is a list of destinations, and associated guint id's */
  56. struct _GtkTargetList {
  57.   GList *list;
  58.   guint ref_count;
  59. };
  60.  
  61. struct _GtkTargetPair {
  62.   GdkAtom   target;
  63.   guint     flags;
  64.   guint     info;
  65. };
  66.  
  67. GtkTargetList *gtk_target_list_new       (const GtkTargetEntry *targets,
  68.                       guint                 ntargets);
  69. void           gtk_target_list_ref       (GtkTargetList  *list);
  70. void           gtk_target_list_unref     (GtkTargetList  *list);
  71. void           gtk_target_list_add       (GtkTargetList  *list,
  72.                         GdkAtom         target,
  73.                       guint           flags,
  74.                       guint           info);
  75. void           gtk_target_list_add_table (GtkTargetList        *list,
  76.                       const GtkTargetEntry *targets,
  77.                       guint                 ntargets);
  78. void           gtk_target_list_remove    (GtkTargetList  *list,
  79.                       GdkAtom         target);
  80. gboolean       gtk_target_list_find      (GtkTargetList  *list,
  81.                       GdkAtom         target,
  82.                       guint          *info);
  83.  
  84. /* Public interface */
  85.  
  86. gint gtk_selection_owner_set (GtkWidget       *widget,
  87.                   GdkAtom           selection,
  88.                   guint32           time);
  89. void gtk_selection_add_target (GtkWidget           *widget, 
  90.                    GdkAtom              selection,
  91.                    GdkAtom              target,
  92.                    guint                info);
  93. void gtk_selection_add_targets (GtkWidget            *widget, 
  94.                 GdkAtom               selection,
  95.                 const GtkTargetEntry *targets,
  96.                 guint                 ntargets);
  97. gint gtk_selection_convert   (GtkWidget       *widget, 
  98.                   GdkAtom           selection, 
  99.                   GdkAtom           target,
  100.                   guint32           time);
  101.  
  102.  
  103. void gtk_selection_data_set (GtkSelectionData *selection_data,
  104.                  GdkAtom           type,
  105.                  gint              format,
  106.                  guchar           *data,
  107.                  gint              length);
  108.  
  109. /* Called when a widget is destroyed */
  110.  
  111. void gtk_selection_remove_all      (GtkWidget *widget);
  112.  
  113. /* Event handlers */
  114.  
  115. gint gtk_selection_clear           (GtkWidget           *widget,
  116.                     GdkEventSelection *event);
  117. gint gtk_selection_request         (GtkWidget            *widget,
  118.                     GdkEventSelection *event);
  119. gint gtk_selection_incr_event      (GdkWindow         *window,
  120.                     GdkEventProperty  *event);
  121. gint gtk_selection_notify          (GtkWidget         *widget,
  122.                     GdkEventSelection *event);
  123. gint gtk_selection_property_notify (GtkWidget         *widget,
  124.                     GdkEventProperty  *event);
  125. GtkSelectioData *gtk_selection_data_copy (GtkSelectionData *data);
  126. void         gtk_selection_data_free (GtkSelectionData *data);
  127.  
  128.  
  129.  
  130. #ifdef __cplusplus
  131. }
  132. #endif /* __cplusplus */
  133.  
  134.  
  135. #endif /* __GTK_SELECTION_H__ */
  136.